home *** CD-ROM | disk | FTP | other *** search
/ Java Certification Exam Guide / McGrawwHill-JavaCertificationExamGuide.iso / pc / Web Links and Code / code / chap14 / B.java next >
Encoding:
Java Source  |  1997-04-20  |  310 b   |  14 lines

  1. import java.awt.*;
  2. import java.applet.*;
  3.  
  4. public class B extends Applet {
  5.    public void init() {
  6.       add(new Button("click me"));
  7.    }
  8.    public boolean handleEvent(Event e)
  9.       if (e.target instanceof Button)
  10.          System.out.println("clicked");
  11.       return super.handleEvent(e);
  12.    }
  13. }
  14.